package cn.changeforyou.cmd.generator.db.mybatisplus;

import cn.changeforyou.analyzer.combine.orm.compare.EntityAndXmlComparator.XmlCompareResult;
import cn.changeforyou.analyzer.combine.orm.compare.EntityAndXmlComparator.XmlCompareResultNode;
import cn.changeforyou.analyzer.combine.orm.compare.compareResultProcessor.InsertAndDeleteXmlLabelCompareResultProcessor;
import cn.changeforyou.analyzer.xmlparse.mybatis.model.MybatisXmlContent;
import cn.changeforyou.cmd.generator.GeneratorContext;
import java.util.List;

/**
 * 主类方法的代码太多了, 把
 */
public class XmlCompareResultExecutor {

	public boolean execute(XmlCompareResult result, MybatisXmlContent mybatisXmlContent, GeneratorContext context){
		List<XmlCompareResultNode> resultNodes = result.getResultNodes();
		context.putInClassMap(mybatisXmlContent.getFile());
		for (XmlCompareResultNode node : resultNodes) {
			if (node.isOk()) {
				continue;
			}
			context.putInClassMap(node);
			InsertAndDeleteXmlLabelCompareResultProcessor processor = new InsertAndDeleteXmlLabelCompareResultProcessor();
			boolean start = processor.start();
			System.out.println(start);
		}
		return true;
	}
}
